package com.hxkcloud.patient.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

/**
 * Created by ray_lei on 2016/7/5.
 */
public class YjhDBManager {


    private SQLiteDatabase database;
    private Context mContext;
    private YjhDBHelper mHelper = null;

    public YjhDBManager() {
        super();
    }

    public YjhDBManager(Context context){
        super();
        this.mContext = context;
    }

    public SQLiteDatabase getDatabase(){
        if(mHelper == null){
            mHelper = new YjhDBHelper(mContext);
        }
        database = mHelper.getWritableDatabase();

        return database;
    }

    public void closeDatabase() {
        if (this.database != null){
            this.database.close();
        }
    }

}
